export function renderPainterToImage(painterRef: LPainterRef | null, jsonSchema: PainterBoard): Promise<string> {
  return new Promise(async (resolve, reject) => {
    if (!painterRef) return reject('painterRef is null');
    // 渲染
    await painterRef?.render(jsonSchema);
    // 生成图片
    const { tempFilePath } = await painterRef.canvasToTempFilePath({ fileType: 'png', pathType: 'url' })
    resolve(tempFilePath)
  })
}